package com.bookmall.cart.feign;

import com.bookmall.cart.domain.vo.BookInfoVo;
import com.bookmall.cart.domain.vo.BookWareInfoVo;
import com.bookmall.cart.domain.vo.WareBookLockVo;
import com.ruoyi.common.core.web.domain.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Description:
 * @Author 胡菜鸡
 * @Create 2022-04-19-11:06
 */
@FeignClient("bookmall-product")
public interface ProductFeignService {

    /**
     * 获取书籍详细信息
     * @author 胡菜鸡
     * @date 2022/4/19 11:08
     */
    @GetMapping("/product/bookInfo/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id);

    @GetMapping("/item/{bookId}.html")
    public String bookItem(@PathVariable("bookId") String bookId);

    /**
     * 为某个商品锁定库存
     * @author 胡菜鸡
     * @date 2022/4/25 9:17
     */
    @PostMapping("/product/bookInfo/lock/order")
    public AjaxResult orderLockStock(@RequestBody WareBookLockVo wareBookLockVo);

    /**
     * 批量修改书籍基本信息
     * @author 胡菜鸡
     * @date 2022/4/26 14:47
     */
    @PutMapping("/product/bookInfo/lock")
    public AjaxResult editLock(@RequestBody List<BookWareInfoVo> bookInfoVoList);
}
